fix(schemas): brain-spec used the wrong ID namespace; add a cross-schema check - #12
Merged
Merged
Conversation
…ema check brain-spec.schema.yaml shipped in #9 with `trust_signature.stage` as T01-T04, while every other file in this repo uses aux.T01-aux.T04. A spec passing one schema would fail the other, and nothing would have noticed until someone wrote one. That is the exact ID fork #9's own description warned about, and I let it through. Caught by a validator someone else wrote and pointed at this repo, which is the argument for having one here. Two changes: - brain-spec.schema.yaml: stage enum moved into the aux. namespace - schemas/validate.py: cross-reference checks, wired into CI yamllint proves each file is well-formed. This proves they agree with each other: every gap resolves to a real heuristic and a real trust stage, every consequence-cap heat band to a real autonomy level, and enums duplicated across schemas stay in step. On current main it fails, naming the brain-spec mismatch. With the fix it passes 6 checks and skips 3. The skips matter as much as the passes. A check whose source key is absent reports `skip` with the reason, never `ok` — trust-gap-taxonomy carries no `families` key and trust-contract no `patterns` key, so those cross-references cannot run yet. A validator that reports success for a comparison it never made is worse than no validator. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MhpqWEvwKp7NrmJfdXYq4M
This was referenced Sep 4, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
brain-spec.schema.yaml, which I added in #9, declarestrust_signature.stageasT01–T04while every other file in this repo usesaux.T01–aux.T04. A spec passing one schema would fail the other, and nothing here would have noticed until someone wrote one.That is precisely the ID fork #9's own description warned about, and I let it through. It was caught by a validator someone else wrote and pointed at this repo — which is the argument for having one.
Changes
schemas/brain-spec.schema.yaml— stage enum moved into theaux.namespace.schemas/validate.py— cross-reference checks, wired into CI as a new step.yamllintproves each file is well-formed. This proves the files agree with each other: every gap resolves to a real heuristic and a real trust stage, every consequence-cap heat band to a real autonomy level, and enums duplicated across schemas stay in step.On current
mainit fails, naming the mismatch:With the fix:
Why the skips are the interesting part
A check whose source key is absent reports
skipwith the reason, neverok.trust-gap-taxonomy.yamlcarries nofamilieskey andtrust-contract.yamlnopatternskey, so those cross-references cannot run yet — and the tool says so rather than claiming a comparison it never made.That distinction is not hypothetical. An earlier draft of this validator reported
okfor "gaps → heuristics resolve" after zero comparisons, because it looked for a key namedheuristicwhile this repo usesheuristic_ref. A validator that reports success for a check it never ran is worse than no validator, and this one is now built not to.The three skips also become useful signal: they mark exactly where
trust-gap-taxonomy.yamlandtrust-contract.yamlare thinner than the versions discussed in #9's out-of-scope list. Enrich either file and the checks switch themselves on.Linked Issue
None required — no IDs introduced, and
aux.T01–aux.T04already exist. This aligns a file that had drifted out of the established namespace, so it is a correction rather than a vocabulary change.Type
Contribution bar — checklist
debateIssue first. — no new IDs; a file is brought into the existing namespace.yamllintclean,check:schemasclean,check-coverage.py12/12, links resolve.Out of scope
The agent-spec v1 migration package — v1 schema,
migrate-v0-to-v1.py,MIGRATION.md. Held for #10, with one finding worth recording there: the swap costs about four lines inaux-audit(spec.tsreads the schema by filename,sync-schemas.mjslists it, two test references), and 34/34 pass after repointing them atagent-spec.v0.yaml. Cheaper than #10 estimates.But a spec written to v1 and fed to the shipped CLI is rejected with four misleading errors —
`autonomy` is required, for fields v1 deliberately removed. So publishing v1 under the canonical filename while the CLI still reads v0 replaces an inconsistent document with a broken tool. Options and a proposed shim go in #10.🤖 Generated with Claude Code
https://claude.ai/code/session_01MhpqWEvwKp7NrmJfdXYq4M
Generated by Claude Code